new Vue({
    el: '#app',
    mixins: [Save],//组件配置文件，路径/utils/components.js
    data() {
        return {
            dataForm: {},
            crop_type: []
        }
    },
    mounted() {
        /**
         * 组件配置文件中自动执行方法
         * 1.this.init(); //初始化文件
         * 2.this.getData(); //仅修改时执行，根据BOM配置属性查询
         */
        this.getList();
    },
    methods: {
        getList() {//查询
            try {
                const { tableName, primaryKey } = $('#form').data('options');
                httpRequest({
                    url: '/generalBusiness/generalQueryForObtainingTrees',
                    data: {
                        TableName: tableName,
                        NodeCode: ''
                    },
                    type: "GET"
                }).then(data => {
                    if (this.action == 'Modify') { //仅修改时生效
                        configTree(data, primaryKey, this.nodeKey);
                    }
                    this[tableName] = data;
                }).catch(xhr => {
                    this.$message({
                        message: '系统错误，请联系开发者!',
                        type: 'error'
                    })
                })
            } catch (error) {
                console.error(error);
                this.$message.error("系统错误，请联系开发者!")
            }
        }
    }
})